(function($) {
	$(document).ready(function(e) {
	
		
		$("#btn-dialog-login").click(function(){
            $("#dialog-login").dialog({autoOpen: false,
			width: "500", 
			height: "450", modal: true}).dialog('open');
        });    
        
        $("#btn-dialog-registrasi").click(function(){
            $("#dialog-registrasi").dialog({autoOpen: false,
			width: "600", 
			height: "550", modal: true}).dialog('open');
        });
        
        $("#link-dialog-login").click(function(){
            $("#dialog-login").dialog({autoOpen: false,
			width: "500", 
			height: "450", modal: true}).dialog('open');
        });    
        
        $("#link-dialog-registrasi").click(function(){
            $("#dialog-registrasi").dialog({autoOpen: false,
			width: "600", 
			height: "550", modal: true}).dialog('open');
        });    
		
		$("#nis").bind('change', function () {
			var url = "functions/crud/user_crud.php";
			var nis = $("#nis").val();
			$.post(url, {"nis": nis, operation: "get_text"} ,function(data) {
				$("#username").val(data);
			});
		});
		
	});
}) (jQuery);
